package com.egg.mall.entity.sku;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.egg.common.core.model.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


/**
 * <p>
 * 商品SKU表
 * </p>
 *
 * @author east
 * @since 2022-08-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "mall_sku")
@ApiModel(value = "Sku对象", description = "商品SKU表")
public class Sku extends BaseEntity {


    @ApiModelProperty(value = "编码")
    @TableField(value = "code")
    private String code;

    @ApiModelProperty(value = "SPU ID")
    @TableField(value = "spu_id")
    private Long spuId;

    @ApiModelProperty(value = "名称")
    @TableField(value = "name")
    private String name;

    @ApiModelProperty(value = "价格(单位:分)")
    @TableField(value = "price")
    private Long price;

    @ApiModelProperty(value = "库存数量")
    @TableField(value = "stock_quantity")
    private Integer stockQuantity;

    @ApiModelProperty(value = "图片地址")
    @TableField(value = "pic_url")
    private String picUrl;

    @ApiModelProperty(value = "规格值, 以英文逗号(,)分割")
    @TableField(value = "spec_ids")
    private String specIds;

    @ApiModelProperty(value = "快照版本号", notes = "用于快照记录,不对外使用")
    @TableField(value = "snapshot_version")
    private Long snapshotVersion;

    @Version
    @ApiModelProperty(value = "库存版本号", notes = "用于库存变动乐观锁,不对外使用")
    @TableField(value = "version")
    private Long version;

}
